/// \file Element.h
/// \date 2012-12-05
/// \brief Abstract Class that defines an element of the snake

#ifndef SNAKE_MODEL_ELEMENT_H_
#define SNAKE_MODEL_ELEMENT_H_

namespace Model
{

/// \brief Abstract Class that defines an element of the snake
class Element
{
    public:
        // ========== LIFECYCLE ========== //

        /// \brief Constructor
        Element(const int &pos_x, const int &pos_y);

        /// \brief Destructor
        /// \details does not releases next element
        virtual ~Element();

        // ========== OVERLODED OPERATORS ========== //
        
        // ========== METHODS ========== //
        
        /// \brief gives its position to the next element, and updates its position
        void move(const int &new_x_position, const int &new_y_position);
        
        // ========== GETTERS ========== //
        
        /// \brief returns x position
        int getXPosition() const;

        /// \brief returns y position
        int getYPosition() const;

        /// \brief returns next element
        const Element* getNextElement() const;
        
        // ========== SETTERS ========== //

        /// \brief sets new position
        void setPosition(const int& new_x_position, const int& new_y_position);
        
        /// \brief sets next element
        void setNextElement(Element* element);

        // ========== INQUIRY ========== //
        
    private:
        // ========== INTERNAL METHODS ========== //

        // ========== ATTRIBUTES ========== //
        /// \brief position in the scene, x value
        int x;
        
        /// \brief position in the scene, y value
        int y;

        /// \brief next body element
        Element* next_element;
};
};

#endif // SNAKE_MODEL_ELEMENT_H_
